def common_assert(self, resp, code, status, msg):
    # 必选参数断言
    if resp.status_code:
        self.assertEqual(code, resp.status_code)

    if resp.json().get("status"):
        self.assertEqual(status, resp.json().get("status"))

    try:
        # 可选msg断言
        if "msg" in resp.json() :
            self.assertEqual(msg, resp.json().get("msg"))
    except ValueError:
        raise AssertionError("响应缺少必要参数")

